<!--
 * @Descripttion: 
 * @version: 
 * @Author: wtzhang
 * @Date: 2021-07-28 15:09:36
 * @LastEditors: wtzhang
 * @LastEditTime: 2021-07-29 10:48:55
-->
<template>
    <div>
      <h3>当前最新 count 值： {{count}}</h3>
      <h3>当前最新 getters 值： {{showNum}}</h3>
      <button @click="btnHander">-1</button>
    </div>
</template>

<script>
import { mapState, mapMutations, mapGetters } from 'vuex'
export default {
    data(){
    return {}
  },
  computed: {
    ...mapState(['count']),
    ...mapGetters(['showNum'])
  },
  methods: {
    ...mapMutations(['subtractN', 'subtract']),
    btnHander(){
      this.subtract()
    }
  }
}
</script>

<style lang="scss" scoped>
    
</style>